<!-- 起草 需要先一步展示的列表界面 -->
<template>
    <div id="showpop">

        <div class="nav bg-theme color-f text-l">
            <div style="display:flex;flex:2;">

                <i class="iconfont icon-fanhui font19 pl08 iback" @click="$router.back(-1)"></i>
                <span class="font19 ml16"> {{ pageTitle }}</span>
            </div>

            <span style="margin-right:10px;margin-left:10px">
                <van-icon @click="showFilterPopupView = true" name="search" size="25" />
            </span>
        </div>

        <van-tabs v-model="active" color="#1989fa" sticky animated line-width="33%" offset-top="50">

            <van-tab title="OA公文系统会议纪要">
                <Drawup_hyjy_tab ref="oa" />
            </van-tab>

            <van-tab title="DICT系统会议纪要（省公司）">
                <Drawup_hyjy_dict_tab ref="dict" />
            </van-tab>

        </van-tabs>

        <van-popup v-model="showFilterPopupView" position="top" style="padding:20px 0 20px 0" get-container="#showpop">
            <div>
                <van-field v-if="active == 0" label-width="4.5em" v-model="title" label="文件标题:" placeholder="请填写文件标题" />
                <van-field v-if="active == 0" label-width="4.5em" v-model="zihao" label="文件字号:" placeholder="请填写文件字号" />
            </div>

            <div>
                <van-field v-if="active == 1" label-width="2.5em" v-model="meetingTheme" label="主题:"
                    placeholder="请填写主题" />
                <van-field v-if="active == 1" label-width="4.5em" v-model="meetingNumber" label="会议编号:"
                    placeholder="请填写会议编号" />
            </div>


            <!-- 按钮 -->
            <div style="display: flex;margin:20px 0 0 0">
                <div style="width:50% ;text-align: center;">
                    <van-button style=" display: inline-block;margin:0 20px 0 20px;padding:0 36px 0 36px"
                        @click="resetButtonClick()" type="default">
                        重置</van-button>
                </div>

                <div style="width:50%;text-align: center;">
                    <van-button style=" display: inline-block;margin:0 20px 0 20px;padding:0 36px 0 36px"
                        @click="sureButtonClick()" type="primary" color="#60a9ec">
                        查询</van-button>
                </div>
            </div>
        </van-popup>
    </div>
</template>

<script>


import jDrawupUtil from '@/assets/js/dict_process_helper';

import { mapGetters } from "vuex"
import { Notify, Toast } from 'vant'
import moment from 'moment'
import { getDictList } from '@/api/dictapi'
import Drawup_hyjy_tab from '../drawup_tab/drawup_hyjy_tab.vue';
import Drawup_hyjy_dict_tab from '../drawup_tab/drawup_hyjy_dict_tab.vue';

export default {
    data() {
        return {

            pageTitle: '选择会议纪要',
            showFilterPopupView: false,

            title: '',
            zihao: '',
            meetingTheme: '',
            meetingNumber: '',
            active: 0,
        }
    },

    computed: {

    },

    //生命周期--创建完成
    created() {


    },


    beforeRouteEnter(to, from, next) {

        next(vm => {

            // console.log('AA', to, 'AAAA', from);
            // 通过 `vm` 访问组件实例
            if (from.name === 'xmjj') {

                
            }
        });
    },


    components: {
        Drawup_hyjy_tab,
        Drawup_hyjy_dict_tab
    },

    //生命周期--创建完成
    activated() {

        // 数据重置


    },

    //生命周期--挂载完成
    mounted() {


    },




    //方法调用
    methods: {

        // 数据重置
        resetListDatas() {

            this.active = 0;
            
            
        },

        resetButtonClick() {

            this.showFilterPopupView = false;
            if (this.active == 0) {
                
                this.$refs.oa.requestDataWithFliterCondition({title: '', zihao: ''});
            }
            else
            {
                this.$refs.dict.requestDataWithFliterCondition({ meetingTheme: '', meetingNumber: '' });
            }
        },

        sureButtonClick() {

            this.showFilterPopupView = true;
            if (this.active == 0) {

                this.$refs.oa.requestDataWithFliterCondition({ title: this.title, zihao: this.zihao });
            }
            else {
                this.$refs.dict.requestDataWithFliterCondition({ meetingTheme: this.meetingTheme, meetingNumber: this.meetingNumber });
            }

        },
        
    }
}
</script>

<style scoped>
.errorPlace {
    position: absolute;
    margin-top: -80px;
    top: 50%;
    margin-left: -50px;
    left: 50%;
}
</style>